﻿<%@ Page Language="C#" MasterPageFile="~/Company/MasterPage.master" AutoEventWireup="true" CodeFile="Modify.aspx.cs" Inherits="Company_Modify" Title="无标题页" %>

<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
         <script type="text/javascript">
        var template = '<span style="color:{0};">{1}</span>';

        var Shenhe = function (value) {
            if(value==0){return String.format(template,'red', '未审');}
            if(value==1){return String.format(template,'green', '同意');}
            if(value==2){return String.format(template,'blue', '退回');}
        }
    </script>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:CXDB %>" 
        SelectCommand="select [id], [companyid], [companyname], [manager_status], [other_master_status], [dept_master_status],[intime] from [cx_company_pingjia] where (([enter_user_id] = @enter_user_id) and ([dept_master_status] = @dept_master_status)) order by [id] desc">
        <SelectParameters>
            <asp:CookieParameter CookieName="cuid" Name="Enter_user_ID" Type="Int32" />
            <asp:Parameter DefaultValue="2" Name="Dept_Master_status" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <ext:Store ID="Store1" DataSourceID="SqlDataSource1" runat="server">
    <Reader>
        <ext:JsonReader ReaderID="id">
            <Fields>
                <ext:RecordField Name="companyid" Type="String"></ext:RecordField>
                <ext:RecordField Name="companyname" Type="String"></ext:RecordField>
                <ext:RecordField Name="id" Type="Int"></ext:RecordField>
                <ext:RecordField Name="dept_master_status" Type="Int"></ext:RecordField>
                <ext:RecordField Name="manager_status" Type="Int"></ext:RecordField>
                <ext:RecordField Name="other_master_status" Type="Int"></ext:RecordField>
                <ext:RecordField Name="intime" Type="Date"></ext:RecordField>
            </Fields>
        </ext:JsonReader>
    </Reader>
    <AutoLoadParams>
             <ext:Parameter Name="start" Mode="Raw" Value="0" />
             <ext:Parameter Name="limit" Mode="raw" Value="20" />
     </AutoLoadParams>
    </ext:Store>
    <ext:Store ID="Store2" runat="server">
    <Reader>
        <ext:JsonReader ReaderID="uid">
            <Fields>
                <ext:RecordField Name="uid" Type="Int"></ext:RecordField>
                <ext:RecordField Name="username" Type="String"></ext:RecordField>
            </Fields>
        </ext:JsonReader>
    </Reader>
    </ext:Store>
    <ext:ViewPort runat="server">
    <Body>
        <ext:ColumnLayout runat="server" Split="true" FitHeight="true">
            <Columns>
                <ext:LayoutColumn ColumnWidth="0.5">
                    <ext:Panel ID="Panel1" runat="server" AutoHeight="true">
                        <Body>
                            <ext:GridPanel ID="GridPanel1" AutoHeight="true" runat="server" StoreID="Store1">
                                <ColumnModel>
                                    <Columns>
                                        <ext:Column DataIndex="id" ColumnID="id" Header="档案编号"></ext:Column>
                                        <ext:Column DataIndex="companyid" ColumnID="companyid" Header="户号"></ext:Column>
                                        <ext:Column DataIndex="companyname" ColumnID="companyname" Header="名称"></ext:Column>
                                        <ext:Column DataIndex="dept_master_status" ColumnID="dept_master_status" Header="部门领导态度">
                                        <Renderer Fn="Shenhe" />
                                        </ext:Column>
                                        <ext:Column DataIndex="other_master_status" ColumnID="other_master_status" Header="相关领导态度">
                                        <Renderer Fn="Shenhe" />
                                        </ext:Column>
                                        <ext:Column DataIndex="manager_status" ColumnID="manager_status" Header="公司领导态度">
                                        <Renderer Fn="Shenhe" />
                                        </ext:Column>
                                        <ext:Column DataIndex="intime" ColumnID="intime" Header="提交时间">
                                        <Renderer Fn="Ext.util.Format.dateRenderer('Y-m-d')" />
                                        </ext:Column>
                                        <ext:CommandColumn>
                                                <Commands>
                                                    <ext:GridCommand Text="删除" Icon="Delete"  CommandName="del">
                                                                                                            
                                                    </ext:GridCommand>
                                                </Commands>
                                            </ext:CommandColumn> 
                                    </Columns>
                                </ColumnModel>
                                <SelectionModel>
                                        <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true">
                                            <AjaxEvents>
                                                <RowSelect OnEvent="RowSelect" Buffer="250">
                                                    <EventMask ShowMask="true" Target="CustomTarget" CustomTarget="#{FormPanel1}" />
                                                    <ExtraParams>
                                                        <%-- or can use params[2].id as value --%>
                                                        <ext:Parameter Name="id" Value="this.getSelected().id" Mode="Raw" /> 
                                                    </ExtraParams>
                                                </RowSelect>
                                            </AjaxEvents>
                                        </ext:RowSelectionModel>
                                    </SelectionModel>
                                    <AjaxEvents>
                                        <Command OnEvent="DeleteRow" >
                                        <Confirmation Title="确认信息" ConfirmRequest="true" Message="确认删除吗？"  />
                                            <ExtraParams>
                                                <ext:Parameter Name="id" Value="record.data.id" Mode="Raw">
                                                </ext:Parameter> 
                                            </ExtraParams>
                                        </Command>
                                     </AjaxEvents>
                                  <BottomBar>
                                        <ext:PagingToolBar 
                                            ID="PagingToolBar1" 
                                            runat="server" 
                                            PageSize="20" 
                                            StoreID="Store1" 
                                            />
                                    </BottomBar>
                                    <LoadMask ShowMask="true" />
                            </ext:GridPanel>
                        </Body>
                    </ext:Panel>
                </ext:LayoutColumn>
                <ext:LayoutColumn ColumnWidth="0.5">
                <ext:FormPanel AutoScroll="true" ID="FormPanel1" runat="server" BodyStyle="padding:5px;" 
                        Frame="true"  >
                        <Body>
                             <ext:ContainerLayout ID="ContainerLayout1" runat="server">
                            
                                <ext:Panel ID="Panel2" runat="server" AutoHeight="true" Collapsed="true"  FormGroup="true" Title="用电客户">
                                    <Body>
                                    <ext:Hidden ID="tfid" runat="server"></ext:Hidden> 
                                    
                                    <table border="0" width="100%" cellpadding="10" cellspacing="10">
                                        <tr>
                                            <td style="width:150px; vertical-align:top;text-align:right;" >户号:</td>
                                            <td style="text-align:left;"><ext:Label ID="tfcompanyid" runat="server"></ext:Label> </td>
                                        </tr>
                                        <tr>
                                            <td style="width:150px; vertical-align:top;text-align:right;" >户名:</td>
                                            <td style="text-align:left;"><ext:Label ID="tfcompanyname" runat="server"></ext:Label> </td>
                                        </tr>
                                    </table>         
                                    </Body>
                                </ext:Panel>
                                <ext:Panel ID="Panel3" runat="server" AutoHeight="true" Collapsed="true"  FormGroup="true" Title="欠费">
                                    <Body>
                                    <table border="0" width="100%" cellpadding="10" cellspacing="10">
                                        <tr>
                                            <td style="width:150px; vertical-align:top;text-align:right;" >时间:</td>
                                            <td style="text-align:left;"><ext:DateField runat="server" ID="tfunfee_time"></ext:DateField> </td>
                                        </tr>
                                        <tr>
                                            <td style="width:150px; vertical-align:top;text-align:right;" >金额:</td>
                                            <td style="text-align:left;"> 
                                                <ext:NumberField ID="tfunfee_cash"   runat="server">
                                                </ext:NumberField> </td>
                                        </tr>
                                        <tr>
                                            <td style="width:150px; vertical-align:top;text-align:right;" >情况说明:</td>
                                            <td style="text-align:left;"> 
                                                <ext:TextArea Width="350" runat="server" ID="tfunfee_detail"></ext:TextArea> </td>
                                        </tr>
                                    </table>         
                                    </Body>
                                </ext:Panel>
                                <ext:Panel ID="Panel4" runat="server" AutoHeight="true" Collapsed="true"  FormGroup="true" Title="窃电">
                                    <Body>
                                    <table border="0" width="100%" cellpadding="10" cellspacing="10">
                                        <tr>
                                            <td style="width:150px; vertical-align:top;text-align:right;" >时间:</td>
                                            <td style="text-align:left;"><ext:DateField runat="server" ID="tfthief_time1"></ext:DateField>~<ext:DateField runat="server" ID="tfthief_time2"></ext:DateField> </td>
                                        </tr>
                                        <tr>
                                            <td style="width:150px; vertical-align:top;text-align:right;" >金额:</td>
                                            <td style="text-align:left;"> 
                                                <ext:NumberField ID="tfthief_cash"   runat="server">
                                                </ext:NumberField> </td>
                                        </tr>
                                        <tr>
                                            <td style="width:150px; vertical-align:top;text-align:right;" >情况说明:</td>
                                            <td style="text-align:left;"> 
                                                <ext:TextArea Width="350" runat="server" ID="tfthief_detail"></ext:TextArea> </td>
                                        </tr>
                                    </table>         
                                    </Body>
                                </ext:Panel>
                                <ext:Panel ID="Panel5" runat="server" AutoHeight="true" Collapsed="true"  FormGroup="true" Title="不配合错峰">
                                    <Body>
                                    <table border="0" width="100%" cellpadding="10" cellspacing="10">
                                        <tr>
                                            <td style="width:150px; vertical-align:top;text-align:right;" >时间:</td>
                                            <td style="text-align:left;"><ext:DateField runat="server" ID="tfuncoop_peak_time"></ext:DateField></td>
                                        </tr> 
                                        <tr>
                                            <td style="width:150px; vertical-align:top;text-align:right;" >情况说明:</td>
                                            <td style="text-align:left;"> 
                                                <ext:TextArea Width="350" runat="server" ID="tfuncoop_peak_detail"></ext:TextArea> </td>
                                        </tr>
                                    </table>         
                                    </Body>
                                </ext:Panel>
                                <ext:Panel ID="Panel6" runat="server" AutoHeight="true" Collapsed="true"  FormGroup="true" Title="不配合限电">
                                    <Body>
                                    <table border="0" width="100%" cellpadding="10" cellspacing="10">
                                        <tr>
                                            <td style="width:150px; vertical-align:top;text-align:right;" >时间:</td>
                                            <td style="text-align:left;"><ext:DateField runat="server" ID="tfuncoop_limit_time"></ext:DateField></td>
                                        </tr> 
                                        <tr>
                                            <td style="width:150px; vertical-align:top;text-align:right;" >情况说明:</td>
                                            <td style="text-align:left;"> 
                                                <ext:TextArea Width="350" runat="server" ID="tfuncoop_limit_detail"></ext:TextArea> </td>
                                        </tr>
                                    </table>         
                                    </Body>
                                </ext:Panel>
                                <ext:Panel ID="Panel7" runat="server" AutoHeight="true" Collapsed="true"  FormGroup="true" Title="其他不良行为">
                                    <Body>
                                    <table border="0" width="100%" cellpadding="10" cellspacing="10">
                                        <tr>
                                            <td style="width:150px; vertical-align:top;text-align:right;" >情况说明:</td>
                                            <td style="text-align:left;"> 
                                                <ext:TextArea Width="350" runat="server" ID="tfuncoop_others"></ext:TextArea> </td>
                                        </tr>
                                    </table>         
                                    </Body>
                                </ext:Panel>
                                <ext:Panel ID="Panel8" runat="server" AutoHeight="true" Collapsed="true"  FormGroup="true" Title="附件">
                                    <Body>
                                    <table border="0" width="100%" cellpadding="10" cellspacing="10">
                                        <tr>
                                            <td><ext:FileUploadField runat="server" ID="tffileupload" Icon="Attach"></ext:FileUploadField></td>
                                        </tr>
                                        <tr>
                                            <td>如果有支持以上各项评价的相关证明文件请统一打包压缩作为附件上传，方便审核。<br>建议以说明性文字作为附件文件名。为节约服务器空间，附件仅支持.zip和.rar文件格式</td>
                                        </tr>
                                    </table>         
                                    </Body>
                                </ext:Panel>
                          <ext:Panel ID="Panel88" runat="server" AutoHeight="true" Collapsed="true"  FormGroup="true" Title="发送至领导">
                                 <Body>
                                <table border="0" width="100%" cellpadding="10" cellspacing="10">
                                        <tr>
                                            <td style="width:150px; vertical-align:top;text-align:right;" >领导:</td>
                                            <td style="text-align:left;">
                                            <ext:ComboBox ID="tfdept_master_id" runat="server"
                                                 DisplayField="username" Disabled="true"   ValueField="uid" Editable="false" StoreID="Store2"></ext:ComboBox>
                                            </td>
                                        </tr>
                                        <tr>
                                             <td style="width:150px; vertical-align:top;text-align:right;" >领导意见:</td>
                                            <td style="text-align:left;">
                                                <ext:Label ID="tfdept_master_remark" runat="server">
                                                </ext:Label>
                                            </td>
                                        </tr> 
                                    </table> 
                                    </Body> 
                                    </ext:Panel>
                             
                            </ext:ContainerLayout>
                        </Body>
                        <Buttons>
                            <ext:Button ID="BTNSubmit" runat="server" Text="提交" Icon="DiskBlack">
                                <AjaxEvents>
                                    <Click OnEvent="SubForm">
                                        <EventMask  ShowMask="true" Target="CustomTarget" CustomTarget="#{FormPanel1}"  Msg="提交中..." MinDelay="2000"/>
                                    </Click>
                                </AjaxEvents>
                            </ext:Button>
                        </Buttons>
                    </ext:FormPanel>
                </ext:LayoutColumn>
            </Columns>
        </ext:ColumnLayout>
    </Body>
    </ext:ViewPort>
</asp:Content>

